
package com.fjwt.gz.zhyx.sms;

import com.fjwt.gz.core.model.SmsConfig;
import com.fjwt.gz.core.utils.AliyunSMSKit;
import com.fjwt.gz.core.utils.JsonKit;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class ALYSmsService {


    public void sendSmsCode(String sysType, String phone, String verifyCode, Integer flag, SmsConfig smsConfig) {
        //保存缓存
        SmsUtil.assembleSmsCode(sysType, phone, verifyCode, flag);
        //发送 短信
        AliyunSMSKit.send(smsConfig,smsConfig.getLoginMchTemplateId(),phone, JsonKit.newJson("code",verifyCode));
    }
}